Release 10.1A: OpenEdge Development:
Progress Dynamics Basic Development
Defining an SDO with a temp-table like a database table
Temp-table SDOs are an important technique.
![]()
To define a temp-table that is identical to an actual database table:
- From the SDO wizard, choose Define Temp-tables.
- In the Temp-Table Maintenance dialog box, choose the database table instead of a table from the temp-db database, as shown:
![]()
- In the Query Builder, select the temp-table version of your table from the temp-tables pseudo-database rather than the database table itself, as shown:
![]()
Progress can properly distinguish between a temp-table and a database table of the same name, as in the example
DepartmentTemp-TableSDO. References to the unqualified table name should be taken to mean the temp-table. You can specify the database table using the database name qualifier. So, in the Department SDO, you have an initialization block of code in the procedure’s main block similar to the one for the firstTTMyTableexample.In the following code, you define some place-holder records of your own, and then copy the actual department names and codes from the database table into the temp-table:
Displaying all of those values when the SDO starts up confirms that Progress has correctly interpreted your references to the sports2000.
Departmentdatabase table and theDepartmenttemp-table, as shown in Figure 11–3.Figure 11–3: All values confirmation message box
![]()
Although you must define each viewer or browser you build using a particular SDO, you can connect these visual objects at run time to any SDO that supplies the right fields for them. In the case of the viewer, this means that the field names the viewer asks for must be in the SDO that is its
Data-Source. They do not have to be in the same order, and they do not have to be all the fields defined in the SDO. It does not matter whether the SDO uses a temp-table or an actual database table as its data source. So, a viewer built against a database table (meaning that a SmartDataObject defined against a database table was named in the viewer’s wizard) can be linked to an SDO built against a similar temp-table and used with it in an application. Because it is simply asking for field values, it will not know the difference.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |